import React from 'react'
import { Consumer } from './Root';

const SubNode = (props) => {
  return (
    <div>
      <h3>孙子组件</h3>
      {/* 使用 Consumer 组件接收数据 */}
      <Consumer>
        {(data) => {
          return <p>{data}</p>;
        }}
      </Consumer>
      <hr />
    </div>
  );
};

export default SubNode